package com.visionblue.business.ship.util;

import android.widget.Toast;

/**
 * @author: xlh
 * @date: 2020-05-28 12:45 PM
 * @desc:
 */
public class NavigationUtil {

    public static boolean hideNavigation() {
        boolean ishide;
        try {
            String command;
            command = "LD_LIBRARY_PATH=/vendor/lib:/system/lib service call activity 42 s16 com.android.systemui";
            Process proc = Runtime.getRuntime().exec(new String[]{"su", "-c", command});
            proc.waitFor();
            ishide = true;
        } catch (Exception ex) {
            ishide = false;
        }
        return ishide;
    }

    public static boolean showNavigation() {
        boolean isShow;
        try {
            String command;
            command = "LD_LIBRARY_PATH=/vendor/lib:/system/lib am startservice -n com.android.systemui/.SystemUIService";
            Process proc = Runtime.getRuntime().exec(new String[]{"su", "-c", command});
            proc.waitFor();
            isShow = true;
        } catch (Exception e) {
            isShow = false;
//            e.printStackTrace();
        }
        return isShow;
    }
}
